﻿#region Description
/*  File Name:      MEBaseComponent.cs
 *  Author:         Adam Goodchild
 *  
 *  Description:    This class is used much like an XNA Game Component, but with
 *                  custom functionality.
 *                  All Minimize Engine Components derive from this class, such as Render, Camera,
 *                  etc.
*/
#endregion

#region Using Statements
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MinimizeEngine.Entities;
using Microsoft.Xna.Framework;
#endregion

namespace MinimizeEngine.Components
{
    public abstract class MEBaseComponent
    {
        #region Fields

        /// <summary>
        /// Its Parent - The Entity that this belongs to.
        /// </summary>
        protected MEBaseEntity mParentEntity;

        #endregion

        #region Properties

        /// <summary>
        /// The Entities Parent Entity
        /// </summary>
        public MEBaseEntity Parent
        {
            get { return mParentEntity; }
        }

        #endregion

        #region Initialization

        public MEBaseComponent(MEBaseEntity parent)
        {
            mParentEntity = parent;

            Initialize();
        }

        /// <summary>
        /// Initialize the Component
        /// </summary>
        public virtual void Initialize()
        {
            mParentEntity.AddComponent(this);
        }

        /// <summary>
        /// Load the Components Content
        /// </summary>
        public virtual void LoadContent()
        {

        }

        /// <summary>
        /// Unload the Components Content
        /// </summary>
        public virtual void UnloadContent()
        {

        }

        #endregion

        #region Update

        /// <summary>
        /// Update the Component
        /// </summary>
        /// <param name="gameTime"></param>
        public virtual void Update(GameTime gameTime)
        {

        }

        #endregion

        #region Draw

        /// <summary>
        /// Draw the Component
        /// </summary>
        public virtual void Draw()
        {

        }

        #endregion
    }
}
